import request from '@/utils/request';

export function findFileList (current,size,fileVo){
  return request({
    url: '/file/findFilePage',
    method: 'post',
    params: {
      current,
      size
    },
    data: fileVo
  })
}

/**
 * 添加文件
 */
export function saveFile(file){
  return request({
    url: 'file/addFile',
    method: 'post',
    data: file
  })
}

/**
 * 根据id批量删除文件
 */
export function deleteFilesByIds(ids){
  return request({
    url: '/file/deleteFilesByIds',
    method: 'post',
    params:{
      ids
    }
  })
}

/**
 * 根据id删除文件
 * @param {} id 
 * @returns 
 */
export function deleteFileById(id){
  return request({
    url: '/file/deleteFileById',
    method: 'post',
    params:{
      id
    },
  })
}

/**
 * 根据url删除文件
 * @param {*} url 
 * @returns 
 */
export function deleteFileByUrl(url){
  return request({
    url: '/file/deleteFileByUrl',
    method: 'post',
    params:{
      url
    }
  })
}

/**
 * 根据urls 删除文件
 * @param {} urls 
 * @returns 
 */
export function deleteFileByUrls(urls){
  return request({
    url: '/file/deleteFileByUrls',
    method: 'post',
    params:{
      urls
    }
  })
}

